package com.zlsy.springbootdemo.entity.template;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.joda.time.DateTime;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.TypeAlias;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zhouliang
 * @date 2020/6/1 20:46
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TypeAlias("person")
@Document(indexName = "person", shards = 1, replicas = 0)
public class PersonTemplateEntity implements Serializable {

    @Id
    private Long id;

    @Field(type = FieldType.Keyword)
    private String name;

    @Field(type = FieldType.Integer)
    private Integer age;

    @Field(type = FieldType.Text)
    private String hobby;

    @Field(type = FieldType.Date)
    private Date date;
}
